//
//  LostListTableViewCell.m
//  Find
//
//  Created by lanou3g on 15/10/27.
//  Copyright © 2015年 Reiko. All rights reserved.
//

#import "LostListTableViewCell.h"
#import "LostPhotoCollectionViewCell.h"

// tableviewcell 的高度宏
#define kListTableviewCellHeight 130


@implementation LostListTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self SubViewCell];
    }
    return self;
}




// 自定义cell格式
- (void)SubViewCell
{
    // 图片
    self.listImage = [[UIImageView alloc] initWithFrame:(CGRectMake(15, 10, 35, 35))];
    self.listImage.layer.cornerRadius = self.listImage.width / 2;
    self.listImage.image = [UIImage imageNamed:@"laud_press_down"];
    [self.contentView addSubview:self.listImage];
    
    // 标题
    self.listTitleLabel = [[UILabel alloc] initWithFrame:(CGRectMake(self.listImage.right +  15, 15, kScreenWidth - 15 - self.listImage.width - 15 - 15 - 80, 30))];
    self.listTitleLabel.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:self.listTitleLabel];
    
    // 距离
    
    self.listDistance = [[UILabel alloc] initWithFrame:(CGRectMake(self.listTitleLabel.right + 10, 20, 70, 15))];
   // self.listDistance.text = @"1.5Km";
    self.listDistance.textAlignment = NSTextAlignmentRight;
    self.listDistance.textColor = [UIColor colorWithRed:87/255.0 green:191/255.0 blue:255/255.0 alpha:1];
    self.listDistance.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:self.listDistance];
    
    // 正文
    self.listTextLabel = [[UILabel alloc] initWithFrame:(CGRectMake(15, self.listImage.bottom + 2, kScreenWidth - 30, kListTableviewCellHeight - 30 - 40 - 10))];
    self.listTextLabel.numberOfLines = 0;
    self.listTextLabel.textColor = [UIColor colorWithRed:0.01 green:0.01 blue:0.01 alpha:0.80f];
    self.listTextLabel.font = [UIFont systemFontOfSize:18];
//    self.listTitleLabel.textColor = [UIColor colorWithRed:0.98 green:0.98 blue:0.98 alpha:0.5];
    [self.contentView addSubview:self.listTextLabel];
    
    // 时间
    self.listTimeLabel = [[UILabel alloc] initWithFrame:(CGRectMake(kScreenWidth - 90, self.listTextLabel.bottom + 5, 80, 15))];
    self.listTimeLabel.alpha = 0.5;
    self.listTimeLabel.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:self.listTimeLabel];
    
    // 地址定位信息
    UIImageView * listLocation = [[UIImageView alloc] initWithFrame:(CGRectMake(15, kListTableviewCellHeight - 25, 15, 15))];
   listLocation.image = [UIImage imageNamed:@"iconfont-address-@1x"];
    [self.contentView addSubview:listLocation];

    // 地址信息
    self.listAddressLabel = [[UILabel alloc] initWithFrame:(CGRectMake(listLocation.right + 5, kListTableviewCellHeight - 25, 200, 15))];
    self.listAddressLabel.textColor = [UIColor colorWithRed:87/255.0 green:191/255.0 blue:255/255.0 alpha:1];
    self.listAddressLabel.font = [UIFont systemFontOfSize:12];
//    self.listAddressLabel.text = @"河南省安阳市文峰区";
    [self.contentView addSubview:self.listAddressLabel];
    
    
}
// 封装给内容赋值的方法
- (LostListTableViewCell *)publishModel:(AVObject *)model
{
    return nil;
}




- (void)awakeFromNib {
    // Initialization code
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
